package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.DoGood;
import cn.wolfcode.trip.base.domain.MyDoGood;
import cn.wolfcode.trip.base.mapper.DoGoodMapper;
import cn.wolfcode.trip.base.mapper.MyDoGoodMapper;
import cn.wolfcode.trip.base.service.IDoGoodService;
import cn.wolfcode.trip.base.service.IMyDoGoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MyDoGoodServiceImpl implements IMyDoGoodService {
    @Autowired
    private MyDoGoodMapper myDoGoodMapper;

    public MyDoGood selectDoGoodState(MyDoGood myDoGood) {
        return myDoGoodMapper.selectForMyDoGood(myDoGood);
    }

    public void saveDoGoodState(MyDoGood myDoGood) {
        myDoGoodMapper.insert(myDoGood);
    }

    public void updateDoGoodState(MyDoGood myDoGood) {
        myDoGoodMapper.update(myDoGood);
    }

    public void deleteDoGoodState(MyDoGood myDoGood) {
        myDoGoodMapper.delete(myDoGood);
    }

    public int selectDoGoodCount(Long id) {
        return myDoGoodMapper.selectDoGoodCount(id);
    }

    public int selectTravelDoGoodCount(Long id) {
        return myDoGoodMapper.selectTravelDoGoodCount(id);
    }

    public void updateDoGoodForauthorId(Long authorId) {
        myDoGoodMapper.updateDoGoodForauthorId(authorId);
    }
}
